export interface ServiceOrderItem {
  address: string;
  applicant: string;
  applicantPhone: string;
  applicantUserId: string;
  cancelTime: string;
  cancelUserId: string;
  canceler: string;
  contactsPerson: string;
  contactsPhone: string;
  createdOn: string;
  description: string;
  equipmentNum: number;
  brandChineseName: string;
  brandCode: string;
  brandEnglishName: string;
  brandId: string;
  brandLogo: string;
  equipmentGroup: string;
  equipmentGroupId: string;
  equipmentId: string;
  equipmentInfoId: string;
  equipmentPhotos: string;
  manufacturer: string;
  marking: string;
  nameplateInfos: Array<any>;
  name: string;
  unit: string;
  value: string;
  transportType: string;
  equipmentNo: string;
  equipmentTags: string;
  equipmentType: string;
  equipmentTypeId: string;
  firmwareVersion: string;
  identification: string;
  remark: string;
  softwareVersion: string;
  expectedTime: string;
  faultImages: string;
  faultType: string;
  faultTypeName: string;
  happenTime: string;
  projectId: string;
  projectName: string;
  region: string;
  regionId: string;
  serviceOrderCode: string;
  serviceOrderId: string;
  serviceState: string;
  serviceStateName: string;
  serviceType: string;
  serviceTypeName: string;
}

export interface ServicePageReq {
  happenTimeEnd: string;
  happenTimeStart: string;
  projectId: string;
  serviceOrderCode: string;
  serviceState: string;
  serviceType: string;
}

export interface ApplyNumItem {
  serviceOrdersCancle?: number;
  serviceOrdersReceived?: number;
  serviceOrdersTotal?: number;
  serviceOrdersWaiting?: number;
  serviceOrdersCreated?: number;
  serviceOrdersCreating?: number;
}

export interface TabItem {
  tabName: string;
  icon?: string;
  unicon?: string;
  key: string;
  style?: any;
}
export enum WorkSearchState {
  // ALL = "ALL",
  DISPATCH = "DISPATCH",
  WAITING = "WAITING",
  EXECUTE = "EXECUTE",
  PROGRESS = "PROGRESS",
  FINISHED = "FINISHED",
  CANCEL = "CANCEL",
  OVER = "OVER",
}
export enum WorkSource {
  // ALL = "ALL",
  CREATE = "CREATE",
  RESPONSIBLE = "RESPONSIBLE",
  HELP = "HELP",
  OTHER = "OTHER",
}
export enum WorkSourceAdmin {
  // ALL = "ALL",
  CREATE = "CREATE",
  OTHER = "OTHER",
}
export enum WorkSourceOpera {
  // ALL = "ALL",
  RESPONSIBLE = "RESPONSIBLE",
  HELP = "HELP",
  CREATE = "CREATE",
}

// RESOLVED:已解决;UNRESOLVED:未解决
export enum FinishedType {
  RESOLVED = "RESOLVED",
  UNRESOLVED = "UNRESOLVED",
}
export enum WorkType {
  // "ALL" = "ALL",
  REPAIR = "REPAIR",
  CHECK = "CHECK",
  MAINTAIN = "MAINTAIN",
  INSTALL = "INSTALL",
  DEBUG = "DEBUG",
  REFORM = "REFORM",
}
export enum WorkRoleType {
  ADMIN = "ADMIN",
  OPERATION = "OPERATION",
}
export enum StateColor {
  DISPATCH = "error",
  WAITING = "volcano",
  EXECUTE = "cyan",
  PROGRESS = "blue",
  CONSTRUCTION = "blue",
  FINISHED = "success",
  CANCEL = "default",
  OVER = "error",
  EVALUATED = "success",
  VISITED = "success",
}

export enum StateColorList {
  DISPATCH = "#f56d6a",
  WAITING = "#fd8358",
  EXECUTE = "#39c9e1",
  PROGRESS = "#4b8bf4",
  CONSTRUCTION = "#4b8bf4",
  FINISHED = "#38ce7b",
  CANCEL = "#7b879a",
  OVER = "#38ce7b",
  EVALUATED = "#38ce7b",
  VISITED = "#38ce7b",
}

export interface WorkOrderItem {
  address?: string;
  contactsPerson?: string;
  contactsPhone?: string;
  description?: string;
  descriptions?: string;
  equipmentNum?: number;
  faultType?: string | null;
  equipmentId?: string;
  equipmentName?: string;
  expectedTime?: string;
  faultImages?: Array<string | undefined>;
  happenTime?: string;
  latitude?: string;
  longitude?: string;
  projectId?: string;
  region?: string;
  regionId?: string;
  serviceId?: string;
  serviceOrderCode?: string;
  workOrderType?: string;
  customerName?: string;
  customerId?: string;
  projectName?: string;
  serviceOrderId?: string;
  workType?: string;
  workOrderId?: string;
  country?: string;
  location?: {
    latitude: string;
    longitude: string;
  };
  locations?: {
    latitude: string;
    longitude: string;
  };
  _address?: string;
}

export interface RevokeServiceOrderItem {
  serviceOrderId: string;
}

export interface SumItem {
  workOrdersCancel?: number;
  workOrdersDispatch?: number;
  workOrdersExecute?: number;
  workOrdersFinished?: number;
  workOrdersOver?: number;
  workOrdersProgress?: number;
  workOrdersTotal?: number;
  workOrdersWaiting?: number;
}

/**
 * CREATE:"创建工单",
 * CANCEL:"取消",
 * DISPATCH:"派工",
 * REASSIGNMENT:"改派",
 * TURNDISPATCH:"转派",
 * EXECUTE:"执行",
 * RECEIVING:"接单",
 * REFUSE:"拒接",
 * TURNBACK:"退回",
 * CONSTRUCTION:"施工",
 * FINISH:"完工",
 * VISIT:"回访",
 * SEARCHEVALUATE:"查看评价",
 * SIGNIN:"签到",

*/
export enum BtnType {
  CREATE = "CREATE", // 创建工单
  CANCEL = "CANCEL", // 取消
  DISPATCH = "DISPATCH", // 派工
  REASSIGNMENT = "REASSIGNMENT", // 改派
  TURNDISPATCH = "TURNDISPATCH", // 转派
  EXECUTE = "EXECUTE", // 执行
  RECEIVING = "RECEIVING", // 接单
  REFUSE = "REFUSE", // 拒接
  TURNBACK = "TURNBACK", // 退回
  CONSTRUCTION = "CONSTRUCTION", // 施工
  FINISH = "FINISH", // 完工
  VISIT = "VISIT", // 回访
  SEARCHEVALUATE = "SEARCHEVALUATE", // 查看评价
  SIGNIN = "SIGNIN", // 签到
  SEARCHEVISIT = "SEARCHEVISIT", // 查看回访
}

export interface WorkOrderOperation {
  workOrderId?: string;
  worksOrderId?: string;
  serviceOrderId?: string;
}
export interface DispatchWorkOrderItem {
  helperUserIds?: Array<string>;
  operationUserId?: string;
  opinion?: string;
  plannTime?: string;
  workOrderId?: string;
}
export interface EquipmentVo {
  description: string;
  equipmentGroup: string;
  equipmentGroupId: string;
  equipmentId: string;
  equipmentNo: string;
  location: string;
  brandVo: brandVo;
  equipmentInfo: EquipmentInfo;
}
export interface NameplateInfo {
  name: string;
  value: string;
  unit: string;
}
export interface EquipmentInfo {
  equipmentInfoId: string;
  equipmentPhotos: string;
  equipmentPhotoList: string[];
  manufacturer: string;
  marking: string;
  nameplateInfos: Array<NameplateInfo>;
  transportType: string;
}
export interface brandVo {
  brandChineseName: string;
  brandCode: string;
  brandEnglishName: string;
  brandId: string;
  brandLogo: string;
}
export interface HelpUsers {
  operationUserId: string;
  helperUserId: string;
  helperUserName: string;
  helperUserPhone: string;
  operationUserName: string;
  operationUserPhone: string;
  opinion: string;
  plannTime: string;
  workOrderId: string;
  workOrderOperationId: string;
}
export interface WorkOrderOperationResponse {
  helperUserIds: string;
  helperUsers: Array<HelpUsers>;
  helperUserName: string;
  helperUserPhone: string;
  operationUserId: string;
  operationUserName: string;
  operationUserPhone: string;
  opinion: string;
  plannTime: string;
  workOrderId: string;
  workOrderOperationId: string;
}

export interface WorkOrderInfo {
  appoint?: string;
  appointPhone?: string;
  appointTime?: string;
  helperUserName?: string;
  appointUserId?: string;
  createdOn?: string;
  customerId?: string;
  customerName?: string;
  contactsPerson?: string;
  contactsPhone?: string;
  description?: string;
  equipmentNum?: number;
  faultType?: string;
  faultImagesUrls?: Array<string>;
  equipmentFaultTypeName?: string;
  equipmentId?: string;
  equipmentName?: string;
  plannTime?: string;
  equipmentVo?: EquipmentVo;
  faultImages?: Array<string | undefined>;
  happenTime?: string;
  projectId?: string;
  projectName?: string;
  serviceId?: string;
  serviceOrderCode?: string;
  serviceOrderId?: string;
  sponsor?: string;
  sponsorId?: string;
  sponsorPhone?: string;
  sponsorTime?: string;
  workOrderCode?: string;
  workOrderExtend?: string;
  workOrderId?: string;
  workOrderOperationResponse?: WorkOrderOperationResponse;
  workOrderState?: string;
  workOrderStateName?: string;
  workOrderType?: string;
  workOrderTypeName?: string;
  operationFlag?: number;
  evaluatesState?: string;
  visitState?: string;
  serviceType?: string;
  address?: string;
  updateHelperFlag?: number;
  updatePlannTimeFlag?: number;
}

export type PartialWorkOrderInfo = Partial<WorkOrderInfo>;
export interface FunctionMapperItem {
  functions: Array<string>;
  isAdmin: boolean;
  workState: string;
}

export interface RecordItem {
  recordContent?: string;
  recordTime?: string;
  recordUserId?: string;
  recordUserName?: string;
  recordUserPhone?: string;
  workOrderId?: string;
  workOrderRecordsId?: string;
  workOrderState?: string;
  workOrderStateName?: string;
  recordContentDetailed?: string;
}
export interface FlowNoeReq {
  traceNodeDetailResponses: Array<WorkFlowNode>;
  workFlowNodeId: string;
  workFlowNodeRecord: string;
}

export interface WorkOrderConstruction {
  constructionAfterImages?: Array<string | undefined>;
  constructionAppendixs?: Array<string | undefined>;
  constructionAutograph?: string;
  constructionBeforeImages?: Array<string | undefined>;
  failureReason?: Array<string>;
  maintenanceContent?: string;
  maintenanceType?: string;
  workOrderId?: string;
}
export interface ConstructionWorkInfo {
  constructionAfterImages?: Array<string>;
  constructionAppendixs?: Array<string>;
  constructionAutograph?: string;
  constructionBeforeImages?: Array<string>;
  createdBy?: string;
  createdName?: string;
  createdOn?: string;
  failureReason?: Array<string>;
  failureReasonName?: Array<string>;
  maintenanceContent?: string;
  maintenanceType?: string;
  maintenanceTypeName?: string;
  tenantId?: string;
  workOrderConstructionId?: string;
  workOrderId?: string;
}

export interface SigninInfo {
  latitude?: string;
  longitude?: string;
  signInAddress?: string;
  signInTime?: string;
  signInUserId?: string;
  signInUserName?: string;
  signInUserPhone?: string;
  workOrderId?: string;
}

export interface CompleteWorkOrder {
  completedAppendix?: Array<string>;
  completedRemarks?: string;
  completionSituation?: string;
  tenantId?: string;
  workOrderId?: string;
}
export interface CompleteWorkInfo {
  completedAppendix?: Array<string>;
  completedRemarks?: string;
  completedTime?: string;
  completedUserId?: string;
  completedUserName?: string;
  completionSituation?: string;
  createdBy?: string;
  createdOn?: string;
  tenantId?: string;
  workOrderId?: string;
}

export interface WorkFlowNode {
  createdOn?: string;
  createdOnShort?: string;
  operatorUserId?: string;
  operatorUserName?: string;
  operatorUserPhone?: string;
  workFlowNodeId?: string;
  workFlowNodeRecord?: string;
  workFlowNodeState?: string;
  workFlowNodeStateName?: string;
  workOrderId?: string;
}
export interface SignInWorkOrder {
  latitude?: string;
  longitude?: string;
  signInAddress?: string;
  workOrderId?: string;
}
export interface VisitRecordItem {
  visitRecordContent?: string;
  visitRecordSuggestion?: string;
  visitRecordTime?: string;
  visitRecordTitle?: string;
  workOrderId?: string;
  workOrderVisitRecordType?: string;
}

export interface OrderDetails {
  signinInfo: Array<SigninInfo>;
  constructionInfo: ConstructionWorkInfo;
  completeInfo: CompleteWorkInfo;
}

export interface UpdateWorkOrderItem {
  helperUserName?: string;
  helperUserIds?: Array<string>;
  opinion?: string;
  plannTime?: string;
  workOrderId?: string;
}

export interface ServiceWorkOrderReq {
  createdOnEnd?: string;
  createdOnStart?: string;
  evaluatesState?: string;
  orderComplaintState?: string;
  plannTimeEnd?: string;
  plannTimeStart?: string;
  projectIds?: string[];
  searchText?: string;
  workRoleType?: string;
  workSearchState?: string;
  workSource?: string;
  workType?: string;
}
